package po;

import java.io.Serializable;


public class ChooseCoursePO implements Comparable, Serializable{

	private long studentID = 0;
	private long courseID = 0;
	private int score = 0;
	private int chance=0;

	public ChooseCoursePO(long studentID, long courseID, int score) {
		this.studentID = studentID;
		this.courseID = courseID;
		this.score = score;
	}

	public ChooseCoursePO(int chance, long studentID, long courseID) {
		this.studentID = studentID;
		this.courseID = courseID;
		this.chance=chance;
		this.score = -1;
	}

	public long getStudentID() {
		return studentID;
	}

	public void setStudentID(long newStudentID) {
		studentID = newStudentID;
	}

	public long getCourseID() {
		return courseID;
	}

	public void setCourseID(long newCourseID) {
		courseID = newCourseID;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int newScore) {
		score = newScore;
	}
	
	public int getChance(){
		return chance;
	}
	
	public boolean equals(Object obj){
		ChooseCoursePO record=(ChooseCoursePO)obj;
		if((studentID==(record.studentID))&&(courseID==(record.courseID))){
			return true;
		}
		else{
			return false;
		}
	}

	@Override
	public int compareTo(Object obj) {
		ChooseCoursePO po=(ChooseCoursePO)(obj);
		Integer temp1=new Integer(chance);
		Integer temp2=new Integer(po.getChance());
		return temp1.compareTo(temp2);
	}
	
}
